const app = getApp();
Page({
  data: {
    collectList:[],
  },
  async getList(e) {
    let res = await wx.requestAsync({
      url: "my/coll",
      data:{
        uid: app.globalData.user.id,
      }
    });
    let collectList = res.result.coll;
    console.log(res)
    this.setData({ collectList });
  },
  onLoad: function (options) {
    console.log(app.globalData.user.id,);
    
    this.getList();
  },
  
  toCollect: function(e) {
    wx.switchTab({
      url: "/pages/index/index",
    });
  },
  // 跳转到详情页
  toDetail(e) {
    let id = JSON.stringify(e.currentTarget.dataset.id);
    wx.navigateTo({
      url: "../detail/detail?id=" + id,
    });
  },


})